web3.js@0.2x.x web3.version.network
web3.version.network
ネットワークプロトコルのバージョンを返します。
非同期の場合は、次のように記述します。
web3.version.getNetwork(callback(error, result){ ... })
戻り値
String
ネットワークプロトコルのバージョン
サンプルコード
code:example.js
// 同期プログラム
var network = web3.version.network;
console.log(network); // 1
// 非同期プログラム
web3.version.getNetwork((error, result) => {
console.log(result);
});
動作サンプル
https://piyolab.github.io/sushiether/web3.js_v0.2x.x/web3/web3.version.network/
ソースコード
https://github.com/piyolab/sushiether/blob/master/web3.js_v0.2x.x/web3/web3.version.network/index.html
参考
https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionnetwork
#todo
#ネットワークプロトコル についての説明のリンクを貼る
#web3.js@0.2x.x #web3.js